<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>lightBlog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="Zhigang Song">

    <!-- Custom CSS -->
    <link rel="stylesheet" href="/asset/css/main.css" type="text/css">
    <link rel="stylesheet" href="/asset/css/timeline.css" type="text/css">

    <!-- Fonts -->
    <link href='//fonts.useso.com/css?family=Merriweather:900,900italic,300,300italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.useso.com/css?family=Lato:900,300' rel='stylesheet' type='text/css'>

</head>

<body class="">
    <div class="site-wrap">

        <?php include(dirname(__DIR__) . '/header.php'); ?>

        <div class="post p2 p-responsive wrap" role="main">
            <div class="measure">
                <div class="home">

                    <div class="posts">
<h3 class="h4 page-title">Archives Timeline</h3>
                        <ul class="timeline">
<?php

foreach ($list as $key => $archive) {
    list($year, $month) = explode('_', $key);
    echo "<li><time class='time'><span>{$year}</span> <span>{$month}</span></time><div class='icon'></div><ol class='label'>";
    foreach ($archive as $item) {
        $data = array('id' => $item['id']);
        $route = array('c' => 'article', 'a' => 'index');
        $url = url($data, $route);
        $date = date('d', strtotime($item['modified']));
        echo "<li><span class='date'>$date</span><a href='$url'>{$item['title']}</a></li>";
    }
    echo "</ol></li>";
}
?>
                        </ul>


                    </div> <!-- end .posts -->

                </div> <!-- end of .home -->

            </div> <!-- end of .measure -->
        </div> <!-- end of .post -->
    </div> <!-- end of .site-wrap -->

    <?php include(dirname(__DIR__) . '/footer.php'); ?>

</body>
</html>
